<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<div class="box1"></div>
	</body>
</html>
<script type="text/javascript">
	// 两秒之后变成粉色
	let box = document.getElementsByClassName("box1")[0];
	box.onclick = function(){
		setTimeout(() =>{
			this.style.backgroundColor = 'pink';
		},2000);
	}
	// 从数组中返回偶数的元素
	const arr = [1,6,9,10,100,125];
	const result = arr.filter(item => item % 2 == 0);
	console.log(result)
	// 箭头函数适合与this无关的回调，定时器，数组方法回调
</script>
<style type="text/css">
	.box1{
		width: 200px;
		height: 200px;
		background-color: aqua;
	}
</style>
